package zero.tech.core.data;

import java.util.ArrayList;
import java.util.List;

public class PageBean<T> {
	private Integer totalCount;
	private Integer totalPage;
	private Integer pageLength;
	private Integer page;
	private List<T> list = new ArrayList<T>();
	public PageBean() {
		super();
	}
	public PageBean(Integer totalCount, Integer pageLength, Integer page,
			List<T> list) {
		super();
		this.totalCount = totalCount;
		this.pageLength = pageLength;
		this.totalPage=this.totalCount%this.pageLength==0?this.totalCount/this.pageLength:this.totalCount/this.pageLength+1;
		this.page = page;
		this.list = list;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	public Integer getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getPageLength() {
		return pageLength;
	}
	public void setPageLength(Integer pageLength) {
		this.pageLength = pageLength;
	}
	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	@Override
	public String toString() {
		return "PageBean [totalCount=" + totalCount + ", totalPage="
				+ totalPage + ", pageLength=" + pageLength + ", page=" + page
				+ ", list=" + list + "]";
	}
}
